UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eNBSZpivPsl8qRGKj+dFxsxLzM6JS5TcjOwS27PAPiY='
WHERE
key_id = 'a934bb22ffd8efde0822d047d2cdded9024680afae063fa1098c0028760c1404'
AND (
token = 'eNBSZpivPsl8qRGKj+dFxsxLzM6JS5TcjOwS27PAPiY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)