UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1h45opJ/SbIjw4Jc9QHDf197DVjM1o9ERO6Joro9+Hk='
WHERE
key_id = '5c1456b82253630a3227718827efc706f625402ee3132065bff8ec95a5193ac7'
AND (
token = '1h45opJ/SbIjw4Jc9QHDf197DVjM1o9ERO6Joro9+Hk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)