UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CAfqLlHrkMt+mRaofWmcfoQ1xr3wICpb38cq1CdTGrA='
WHERE
key_id = '8892aabe160b475b22d2672e8436c2edce93010fd602c464ca66e8c4e5ec357f'
AND (
token = 'CAfqLlHrkMt+mRaofWmcfoQ1xr3wICpb38cq1CdTGrA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)