UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YF6hh5iWiG8KLkN1SBasrV1vAxBl05rcFva2LZEdY5E=' 
WHERE 
  key_id = 'cada863c05f0c3c51a5deb543d906e062533d4f1b8d002103b01714eb72dfe69' 
  AND (
    token = 'YF6hh5iWiG8KLkN1SBasrV1vAxBl05rcFva2LZEdY5E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044